package config

type Configuration struct {
	Server   Server   `mapstructure:"server" json:"server" yaml:"server"`
	Log      Log      `mapstructure:"log" json:"log" yaml:"log"`
	Database Database `mapstructure:"database" json:"database" yaml:"database"`
}

type Server struct {
	Env          string `mapstructure:"env" json:"env" yaml:"env"`
	Port         string `mapstructure:"port" json:"port" yaml:"port"`
	Name         string `mapstructure:"name" json:"name" yaml:"name"`
	ReadTimeout  int    `mapstructure:"read_timeout" json:"read_timeout" yaml:"read_timeout"`    // 单位：秒
	WriteTimeout int    `mapstructure:"write_timeout" json:"write_timeout" yaml:"write_timeout"` // 单位：秒
	IdleTimeout  int    `mapstructure:"idle_timeout" json:"idle_timeout" yaml:"idle_timeout"`    // 单位：秒
}

type Log struct {
	Level string `mapstructure:"level" json:"level" yaml:"level"`
}

type Database struct {
	Host     string `mapstructure:"host" json:"host" yaml:"host"`
	Port     string `mapstructure:"port" json:"port" yaml:"port"`
	User     string `mapstructure:"user" json:"user" yaml:"user"`
	Password string `mapstructure:"password" json:"password" yaml:"password"`
	Name     string `mapstructure:"name" json:"name" yaml:"name"`
}
